write approval mail data to sqlserver  use RoutingAgent class

In exchange server  create some TransportRule. Like this:

New-TransportRule "Approval1" -HeaderContainsMessageHeader "X-Approval" -HeaderContainsWords "test1-Approval" -ModerateMessageByUser test1@corp.com,test2@corp.com

New-TransportRule "Approval2" -HeaderContainsMessageHeader "X-Approval" -HeaderContainsWords "test2-Approval" -ModerateMessageByUser test3@corp.com,test4@corp.com

When user send email , and test2 user approval this email , I want write some data (from,to,subject,body,sendtime,approvalUser,approvalResult) to sql server ,

In custom RoutingAgent  class OnSubmittedMessage method,

if MapiMessageClass =IPM.Note.Microsoft.Approval.Reply.Approve  this mail is approval mail, and MapiMessageClass= IPM.Note.Microsoft.Approval.Request.Recall or IPM.Note.Microsoft.Approval.Request.reject .

but I dont The original message, The relationship between them was found.

Thanks all.

March 13th, 2015 3:07am

You would need to use the PidTagReportTag property https://msdn.microsoft.com/en-us/library/ee160822%28v=exchg.80%29.aspx to relate the message (although this would contain information about the Message that is being stored in the Arbitration mailbox). But this property would be both present in the Moderation request and Moderation response. To read that property in the Transport Agent you will need to use the TNEFReader eg http://gsexdev.blogspot.com.au/2011/04/reading-custom-mapi-properties-in.html

Cheers
Glen

   
Free Windows Admin Tool Kit Click here and download it now
March 15th, 2015 8:18pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics